import request from '~/utils/request';

export function getBranchTree(data) {
    //机构树形
    return request({
        url: '/Branch/GetBranchTree',
        method: 'get',
        data,
    });
}
export function getBranchList(data) {
    //机构列表
    return request({
        url: '/Branch/GetBranchList',
        method: 'post',
        data,
    });
}
export function getBranchInfo(data) {
    //机构单条记录
    return request({
        url: '/Branch/GetBranchInfo?branchid=' + data,
        method: 'get',
        data,
    });
}
export function saveBranchInfo(data) {
    //机构保存
    return request({
        url: '/Branch/SaveBranchInfo',
        method: 'post',
        data,
    });
}
export function modifyBranchBalance(data) {
    //机构资产调整
    return request({
        url: '/Branch/ModifyBranchBalance',
        method: 'post',
        data,
    });
}

export function getDeptTree(data) {
    //部门树形
    return request({
        url: '/Branch/GetDeptTree',
        method: 'get',
        data,
    });
}
export function getDeptList(data) {
    //部门列表
    return request({
        url: '/Branch/GetDeptList',
        method: 'post',
        data,
    });
}
export function setDeptState(data) {
    //部门设置状态
    return request({
        url: '/Branch/SetDeptState',
        method: 'post',
        data,
    });
}
export function saveDeptInfo(data) {
    //部门保存
    return request({
        url: '/Branch/SaveDeptInfo',
        method: 'post',
        data,
    });
}
export function getDeptSelectList() {
    //部门当前机构的部门
    return request({
        url: '/Branch/GetDeptSelectList',
        method: 'get',
    });
}

export function getBranchSelectList() {
    //获取所有事业机构选择列表{id,name}
    return request({
        url: '/Branch/GetBranchSelectList',
        method: 'get',
    });
}

export function getBusinessCitySelectList() {
    //获取事业机构(用户)所辖城市列表{id,name}
    return request({
        url: '/Branch/GetBusinessCitySelectList',
        method: 'get',
    });
}

export function getDeptInfo(data) {
    //部门取单条记录
    return request({
        url: '/Branch/GetDeptInfo?deptid=' + data,
        method: 'get',
        data,
    });
}

export function getStaffListUser(data) {
    //员工用户表
    return request({
        url: '/Branch/GetStaffListUser',
        method: 'post',
        data,
    });
}
export function saveStaffInfo(data) {
    //员工保存
    return request({
        url: '/Branch/SaveStaffInfo',
        method: 'post',
        data,
    });
}
export function getStaffInfo(data) {
    //员工取单条记录
    return request({
        url: '/Branch/GetStaffInfo?staffid=' + data,
        method: 'get',
        data,
    });
}
